
import matplotlib.pyplot as plt
ax = []
ay = []
plt.ion()
#开启一个画图的窗口
for i in range(100):
    print(i)
    ax.append(i)
    ay.append(i**2)
    plt.clf()
    plt.plot(ax, ay)
    plt.pause(0.1)
    plt.ioff()

